/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.applets.regula;

/**
 *
 * @author Michał
 */
public class Regula{
    
    private String ApBSSID;
    private String ESSID;
    private String ClientMAC;
    private Boolean CzyBlokowac;

    public String getApBSSID() {
        return ApBSSID;
    }

    public void setApBSSID(String ApBSSID) {
        this.ApBSSID = ApBSSID;
    }

    public String getClientMAC() {
        return ClientMAC;
    }

    public void setClientMAC(String ClientMAC) {
        this.ClientMAC = ClientMAC;
    }

    public Boolean isCzyBlokowac() {
        return CzyBlokowac;
    }

    public void setCzyBlokowac(Boolean CzyBlokowac) {
        this.CzyBlokowac = CzyBlokowac;
    }

    public String getESSID() {
        return ESSID;
    }

    public void setESSID(String ESSID) {
        this.ESSID = ESSID;
    }
    

    @Override
    public String toString() {
        String tekst = CzyBlokowac ? "Blokowany" : "Przepuszczany";
        return ApBSSID + "   |    " + ClientMAC + "   |   " + tekst;
    }

    public Regula(String ApBSSID, String ClientMAC, Boolean CzyBlokowac) {
        String[] podzial = ApBSSID.split(" ");
        this.ApBSSID = podzial[0];
        this.ClientMAC = ClientMAC;
        this.CzyBlokowac = CzyBlokowac;
        if(podzial.length>1)
            this.ESSID = podzial[1];
    }

    public Regula(String ApBSSID, String ESSID, String ClientMAC, Boolean CzyBlokowac) {
        this.ApBSSID = ApBSSID;
        this.ESSID = ESSID;
        this.ClientMAC = ClientMAC;
        this.CzyBlokowac = CzyBlokowac;
    }

    public Regula() {
    }
    
    
    
}
